<!DOCTYPE html>
<html xmlns:th="http://www.springframework.org/schema/jdbc">
<head>
    <meta charset="utf-8">
    <title>权限菜单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../static/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="../../../static/expand/eleTree/eleTree/eleTree.css"  media="all">
</head>

<div style="padding: 20px; background-color: #F2F2F2;">

    <div class="layui-row layui-col-space15">
        <!-- 左边树结构-->
        <div class="layui-col-md3">
            <div class="layui-card">
                <!--<div class="layui-card-header"></div>-->
                <div class="layui-card-body">
                    <div  id="roleTree">
                        <div  class="eleTree roleTree" lay-filter="role_tree_data"></div>
                    </div>

                </div>
            </div>
        </div>
        <!-- 右边编辑表单 OR权限-->
        <div class="layui-col-md6" style="float:right">
            <div class="layui-card">
                <!--<div class="layui-card-header"></div>-->
                <div class="layui-card-body">
                    <div style="margin-bottom:20px">
                        <!--<button id="add_perm" type="button" class="layui-btn layui-btn-primary layui-btn-sm">-->
                        <!--<i class="layui-icon">&#xe654;</i>-->
                        <!--</button>-->
                        <button id="edit_perm" type="button" class="layui-btn layui-btn-primary layui-btn-sm">
                            <i class="layui-icon">&#xe642;</i>
                        </button>
                        <!--<button id="deleted_perm" type="button" class="layui-btn layui-btn-primary layui-btn-sm">-->
                        <!--<i class="layui-icon">&#xe640;</i>-->
                        <!--</button>-->
                    </div>
                    <div class="layui-row" id="add_form"  lay-filter="menu_form">
                        <div class="layui-col-md8">
                            <form class="layui-form " action="" id="perm_form"  lay-filter = "perm_form" >


                                <div class="layui-form-item" style="display:none;">
                                    <label class="layui-form-label">permissionId</label>
                                    <div class="layui-input-block">
                                        <input type="text"  id = "permission_id" name="permission_id"   autocomplete="off" class="layui-input layui-disabled" readonly>
                                    </div>
                                </div>

                                <div class="layui-form-item">

                                    <label class="layui-form-label">父节点</label>
                                    <div class="layui-input-block " id="parent_id_from">
                                        <input  type="text"  id = "parent_id" name="parent_id"  autocomplete="off" class="layui-input layui-disabled" readonly>
                                    </div>

                                </div>




                                <div class="layui-form-item">
                                    <label class="layui-form-label">标题</label>
                                    <div class="layui-input-block" id="title_from">
                                        <input type="text"  id = "title" name="title"  required  lay-verify="required" autocomplete="off" placeholder="" class="layui-input layui-disabled" readonly>
                                    </div>
                                </div>


                                <div class="layui-form-item">
                                    <label class="layui-form-label">类型</label>
                                    <div class="layui-input-block" >
                                        <input type="radio" name="type" value="1" title="菜单" checked="" lay-filter="add_type" >
                                        <input type="radio"  name="type" value="2" title="权限"  lay-filter="add_type" >
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">请求方法</label>
                                    <div class="layui-input-block">
                                        <select name="href_method">
                                            <option value="" >请选择</option>
                                            <option value="GET">GET</option>
                                            <option value="POST" >POST</option>
                                            <option value="PUT">PUT</option>
                                            <option value="DELETE">DELETE</option>
                                        </select>
                                    </div>
                                </div>

                                <div id="add_meun" style="display:none;">

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">url地址</label>
                                        <div class="layui-input-block" id="href_from">
                                            <input type="text" id="href" name="href"  required   autocomplete="off" placeholder=" " class="layui-input layui-disabled" readonly>
                                        </div>
                                    </div>


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">菜单图标</label>
                                        <div class="layui-input-block" id="icon_from">
                                            <input type="text" id="icon" name="icon"  required  autocomplete="off" placeholder=" " class="layui-input layui-disabled" readonly>
                                        </div>
                                    </div>



                                    <div class="layui-form-item">
                                        <label class="layui-form-label">是否展开</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox" checked="" id="spread" name="spread" lay-skin="switch" lay-filter="add_switch_spread" lay-text="展开|关闭">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">是否可见</label>
                                        <div class="layui-input-inline">
                                            <input type="checkbox" checked="" id="enable" name="enable" lay-skin="switch" lay-filter="add_switch_enable" lay-text="启用|禁用">
                                        </div>
                                    </div>

                                </div>


                                <div class="layui-form-item">
                                    <label class="layui-form-label">排序号</label>
                                    <div class="layui-input-block" id="sort_number_form">
                                        <input type="text" id="sort_number" name="sort_number"  required   autocomplete="off" placeholder=" " class="layui-input layui-disabled" readonly>
                                    </div>
                                </div>

                                <div class="layui-form-item" id="add_code" style="display:none;">
                                    <label class="layui-form-label">权限代码</label>
                                    <div id="code_form" class="layui-input-block">
                                        <input type="text" id="code" name="code"  required   autocomplete="off" placeholder=" " class="layui-input layui-disabled" readonly>
                                    </div>
                                </div>






                                <div class="layui-form-item" style="margin-top:40px" >
                                    <div id="add_perm_from" class="layui-input-block" style="display:none;">
                                        <button type="button" class="layui-btn  layui-btn-submit " lay-submit="" lay-filter="add_perm_form">添加</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    </div>

                                    <div id="edit_perm_form" class="layui-input-block" style="display:none;">
                                        <button type="button" class="layui-btn  layui-btn-submit " lay-submit="" lay-filter="edit_perm_form">编辑</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    </div>

                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<!-- 右边编辑表单 OR权限 交替显示-->
<div class="layui-row" id="add_menu_form" style="display:none;" >
    <div class="layui-col-md6" align="center">
        <form class="layui-form layui-from-pane" action="" id="add_perm_menu" style="margin-top:20px" lay-filter = "add_menu_form" >

            <div class="layui-form-item">
                <label class="layui-form-label">父节点</label>
                <div class="layui-input-block">
                    <select name="parent_menu_id" id="parent_menu_id" lay-filter="parent_menu_id">
                        <option value="">请选择</option>
                    </select>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">权限名称</label>
                <div class="layui-input-block">
                    <input type="text"  id = "title_menu" name="title_menu"  required  lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">权限类型</label>
                <div class="layui-input-block" >
                    <input type="radio" name="type_menu" value="1" title="菜单" checked="" lay-filter="add_type" >
                    <input type="radio"  name="type_menu" value="2" title="权限"  lay-filter="add_type" >
                </div>
            </div>

            <div id="add_meun_menu">

                <div class="layui-form-item">
                    <label class="layui-form-label">url地址</label>
                    <div class="layui-input-block">
                        <input type="text" id="href_menu" name="href_menu"  required   autocomplete="off" placeholder=" " class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">菜单图标</label>
                    <div class="layui-input-block">
                        <input type="text" id="icon_menu" name="icon_menu"  required  autocomplete="off" placeholder=" " class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">排序号</label>
                    <div class="layui-input-block">
                        <input type="text" id="sort_number_menu" name="sort_number_menu"  required   autocomplete="off" placeholder=" " class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">菜单是否展开</label>
                    <div class="layui-input-inline">
                        <input type="checkbox" checked="" id="spread_menu" name="spread_menu" lay-skin="switch" lay-filter="add_switch_spread" lay-text="展开|关闭">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">是否可见</label>
                    <div class="layui-input-inline">
                        <input type="checkbox" checked="" id="enable_menu" name="enable_menu" lay-skin="switch" lay-filter="add_switch_enable" lay-text="启用|禁用">
                    </div>
                </div>

            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">请求方法</label>
                <div class="layui-input-block">
                    <select name="href_method_menu">
                        <option value="" >请选择</option>
                        <option value="GET">GET</option>
                        <option value="POST" >POST</option>
                        <option value="PUT">PUT</option>
                        <option value="DELETE">DELETE</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item" id="add_code_menu">
                <label class="layui-form-label">权限代码</label>
                <div class="layui-input-block">
                    <input type="text" id="code_menu" name="code_menu"  required   autocomplete="off" placeholder=" " class="layui-input">
                </div>
            </div>



            <div class="layui-form-item" style="margin-top:40px">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn  layui-btn-submit " lay-submit="" lay-filter="add_submitTable_menu">添加</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>

            </div>

        </form>
    </div>

</div>



<script src="../../../static/layui/layui.js" charset="utf-8"></script>
<script src="../../../static/expand/main.js" charset="utf-8"></script>
<script src="../../../static/js/system/menu.js" charset="utf-8"></script>

</body>
</html>
